home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 4
/
Precision Software Applications Silver Collection Volume 4 (1993).iso
/
stats
/
mathx30.exe
/
FINANCE.APL
< prev
next >
Wrap
Text File
|
1991-07-27
|
19KB
|
608 lines
z''=info:z'''=int((z''-int(z''/10000)*10000)/1000):if z'''<>1}2
| FINANCE.APL, Copyright 1991 by David Denker |
| Box 115, Isanti, Mn. 55040 |
dsp n" Sorry, the FINANCE.APL file will not work with MATHXR! "
wait10:quit
#2
Z'''=INT(Z''*.0001):IF Z'''=>300}3
DSP nn; Sorry, this file must be used with MATHX V3.00 or greater!;n
wait20:quit
#3
WIND BB1BF15B14F0Z
over
WIND T1Z:WLCC B6F15
title= FINANCE PROGRAMS
h'''=1
i=sloc:if i=0}1
if i>64}}if i<91}}i=i+32:if i>96}}if i<123}}k=i-97:call8:goto4
#1
digr6:digl6:boff:CALL5:xoff:aon:cls:WLCC L8
menuu I; FINANCE MENU:
;!A;mortization table. (can be printed)
;!B;alance of loan payoff.
;!C;ompound interest
;!E;ffective earnings percentage rate.
;!I;nformation on selections . . .
;!L;oan interest rate. (from No. of payments and amount)
;!P;ayments. (from Int. rate, Loan value & No. payments)
;!Q;uit.
;!S;avings table. (can be printed);x
j=mlvl:if j=0}9
#4
on(j)g{100,600,610,150,500,200,300,9,400}:QUIT
#5:HEAD B0F13" Select by the PICK LETTER or use MOUSE or CURSOR keys."
ret
#8:j=data k{1,2,3,0,4,0,0,0,5,0,0,6,0,0,0,7,8,0,9,0,0,0,0,0,0,0}:ret
#9:quit
#40
poff:dsp n; Do you want a printout? (Y/N) ;:$p=inp{805}
if $p=;Y;}41,if $p=;YES;}41:ret
#41
pon:dsp n; Is the printer on? (Y/N) ;:$p=inp{806}
if $p=;Y;}r:if $p=;YES;}r:poff:ret
#50
hoff:cls:ret
#79:woff
#80
dsp nn; "M"enu, "R"edo, else quit! ;:i'=kyin:cls
if i'=77}1:if i'=109}1:if i'=82}4:if i'=114}4:quit
#90
i'=-1:gos92
DSP n; Enter interest rate %: ;:i'=inp{800}
if i'=-1}r:if i'<0}91:i'=i'*.01
dsp n; Enter total number of payments: ;:t'=inp{801}
if t'<1}91
dsp n; Enter number of payments per year: ;:n''=inp{802}
if n''<1}91
dsp n; Enter loan value: ;:v'=inp{803}
if v'=<0}91
p'=v'/((1-((1+i'/n'')^-t'))/(i'/n''))
hoff:ret
#91
i'=-2:hoff:ret
#92:head ; Hit the F1 key for help.;:ret
#100:call50:XOFF
DSP NN; AMORTIZATION TABLE:;N
call90:if i'=-1}1:if i'=-2}510:call40
n''=1:y''=1:r''=v':p''=0:i''=0:p'''=0:i'''=0
digl7:digr2:n'=1
head ; Hit ESC to quit table display and printing!;
dprn nn; Monthly payment = ;(p');
Payment Amount to Amount to Principal Interest Principal
number Principal Interest to date to date remaining
;n
#103
k''=kyck:if k''=27}1
if y''=y'''}104:digr0:digl3:dprn; Year;(y'')n:y'''=y''
#104
digr0:digl5:dprn (n'):n'=n'+1:n''=n''+1
digl7:digr2
i''=r''*i'/12:p''=p'-i'':p'''=p'''+p'':i'''=i'''+i'':r''=r''-p''
digl5
dprn(p'')(i'')
digl8:dprn(p''')(i''')(r'')n
if n''=13}}y''=y''+1:if n''=13}}n''=1
if n'<t'+1}103
goto80
#150
call50:s'=-99:xoff:call92
dsp n; EFFECTIVE EARNINGS RATE:;
dsp nn; Enter starting balance:;:s'=inp{807}
if s'=-99}1:if s'=0}520:if s'<0}520
dsp n; Enter ending balance: ;:e'=inp{808}
if e'<0}520
dsp n; Enter deposits made: ;:d'=inp{809}
if d'<0}520
dsp n; Enter No. of days involved: (Yr.=365) ;:y'=inp{810}
if y'=<0}520:hoff
m'=e'-s'-d':i=m'/s':c'=4
#151
m'=e'-s'-d'-d'/2*i:i=m'/s':c'=c'-1:if c'<>0}151
digr2:digl4
dsp n;
Approximate Effective Earnings Percentage Rate = ;(i*100);%
Approximate Effective Yearly Percentage Rate = ;(i/y'*365*100);%;n
goto80
#200
call50:n'=0:xoff:call92
DSP N; LOAN INTEREST RATE:;N
dsp n; Enter total number of payments: ;:n'=inp{801}
if n'<0}530:if n'=0}1
dsp n; Enter number of payments per year: ;:n''=inp{802}
if n''=<0}530
dsp n; Enter amount of each payment: ;:p'=inp{811}
t'=p':if p'=<0}530
dsp n; Enter loan amount: ;:p''=inp{803}
if p''=<0}530:c'=5:hoff
#201
i'=(n''*2*(p'*n'-p''))/(p''*(n'+1))
if c'=0}205:c'=c'-1
p'''=p''/((1-((1+i'/n'')^-n'))/(i'/n''))
p'=p'-(p'''-t')*.58:goto201
#205
digr2:digl2:dprn nn; Approximate Loan interest rate = ;(i'*100);%;
goto80
#300
digr2:digl7
call50
DSP NN; PAYMENTS for Loan:;N
call90:if i'=-1}1:if i'=-2}540:digr2:hoff
dsp nn; Monthly payment = ;(p')
goto80
#400
xoff:digr2:koff:woff:b'=-1:gos92
dsp n; SAVINGS ACCOUNT TABLE:;
dsp nn; Enter starting balance: ;:b'=inp{812}
if b'=-1}1:if b'<0}550
dsp n; Enter interest rate: ;:i'=inp{800}
if i'<0}550:i'=i'*.01
dsp n; Enter number of years: ;:y''=inp{813}
if y''<1}550
head ; Select by the letter! Hit the F1 key for help.;
dsp n; Enter interest compound rate:
"Y"early
"S"emi-annually
"Q"uarterly
"M"onthly
"D"aily ;n
#401:$r=inp(1){814}:i''=0
if $r="Y"}}i''=1
if $r="S"}}i''=2
if $r="Q"}}i''=4
if $r="M"}}i''=12
if $r="D"}}i''=365
if i''<>0}402:beep:dsp o" "o:goto401
#402:
i=i'/i''
dsp n; Enter deposit rate:
"N"one
"Y"early
"M"onthly
"W"eekly ;n
#403:$c=inp(1){814}:r'=0
if $c="N"}}r'=400
if $c="Y"}}r'=366
if $c="M"}}r'=32
if $c="W"}}r'=8
if r'<>0}404:beep:dsp o" "o:goto403
#404
gos92
c'=0:if $c="N"}407
dsp n; Enter deposit amount: ;:c'=inp{815}
if c'<0}550
#405
r''=0
dsp n; Enter deposit inflation rate (percentage): ;:r''=inp{816}
r''=r''*.01+1
#407
head ; Select by the letter! Hit the F1 key for help.;
dsp nn; Enter table print and/or display period:
"E"nding ballance only
"Y"early ballance
"M"onthly ballance
"W"eekly ballance ;n
#410:$p=inp(1){814}:p'=0
if $p="E"}}p'=400
if $p="Y"}}p'=366
if $p="M"}}p'=32
if $p="W"}}p'=8
if p'<>0}411:beep:dsp o" "o:goto410
#411
$p=;1 Week;:if p'=8}412
$p=;1 Month;:if p'=32}412
$p=;1 Year;
#412:gos92:poff
dsp n; Do you want a printout? (Y/N) ;:$a=inp(1){805}
if $a<>"Y"}415
dsp n; Is the printer on? (Y/N) ;:$a=inp(1){806}:if $a<>"Y"}415
pon
#415
head ; Hit ESC to quit table display and printing!;
i'''=0:c''=0:q'=91:y'=1:p''=1:m'=32:n'=1:x''=0:m'''=1:q'''=1:m''=1:q''=1
t'=0:t''=0:d'=1:n''=1:n'''=1:b''=0:if p'=400}416
dprn nn;
Starting Balance = ;(b');
Interest rate = ;(i'*100);%
Each period = ;$p;
Interest Deposits
Period Interest Deposit to date to date Balance;n
goto420
| p'' i''' c'' t' t'' b' |
#416
dprn nn;
Starting Balance = ;(b');
Interest rate = ;(i'*100);%
Total Total Ending
Interest Deposits Balance;n
GOTO420
#417
z'=kyck:if z'=27}79
if i''=365}449
if i''=12}}if n'=m'}450
if i''=4}}if n'=q'}450
if i''=2}}if n'=182}450
if i''=1}}if n'=366}450
go421
#420
windd wr3wc12r3c32;
WORKING! ;
#421
if r'=n''}c452:if n'''=p'}c465
if m'<>m''}422:m'''=m'''+1:if m'''=13}}m'''=1
m'=data m'''{0,32,29,32,31,32,31,32,32,31,32,31,32}
if p'>27}}if p'<33}}p'=m':m''=1
#422
if q'<>q''}424:q'''=q'''+1:if q'''=5}}q'''=1
q'=data q'''{0,91,92,93,93}
#424
n'=n'+1:n''=n''+1:m''=m''+1:q''=q''+1:d'=d'+1:n'''=n'''+1
if d'<>367}417:d'=2:n''=1:p''=1
if n'''>365}}n'''=1:if y'=>y''}430:y'=y'+1:goto417
#430:woff:if p'=400}c470:goto80
#449
b'=b'+b'':b''=0
#450
z'=b'*i+x'':b'=b'+z'+b'':i'''=i'''+z':n'=1:x''=0:b''=0:goto421
#452
b''=b''+c':c''=c''+c':if i''=365}460
if i''<>12}454:x'=m'-n':goto459
#454
if i''<>4}456:x'=q'-n':goto459
#456
if i''<>2}458:x'=182-n':goto459
#458
x'=366-n'
#459
x''=x''+x'*(i'/365)*c'
#460
n''=1:ret
#465
t'=t'+i''':t''=t''+c''
if p''<>1}466:digl3:digr0:dprn; Year;(y')n
#466
woff
digr0:digl2
dprn (p'')
digr2:digl8
dprn(i'''):digl6
dprn(c''):digl8
dprn(t'):digl7
dprn(t''):digl9
dprn(b'+b'')n
p''=p''+1:n'''=1:c''=0:i'''=0:c'=c'*r''
windd
ret
#470
t'=t'+i''':t''=t''+c''
digr2:digl9:dprn (t')(t'')(b')n
ret
#500
hoff:if h'''=0}502:h'''=0
windd bb4bf15b14f0; DISCLAIMER:
Even though I have tested all calculations
and believe them to be accurate, I do not
guarantee their accuracy. Your use of the
information provided by this program is at
your own risk. If you are using this program
to make important decisions, I suggest you
also consider contacting a financial planning
professional.
;f4; Hit any key or mouse button to continue.;X
wait50
#502
call5:WLCC L8
MENUU BB1BF15B14F0I; For INFORMATION on:
;!A;mortization table.
;!B;alance of loan payoff.
;!C;ompound interest.
;!E;ffective earnings rate.
;!L;oan interest rate.
;!P;ayments on loan.
;!S;avings table.
E;!X;IT to main menu;X
J=MLVL:on(j)g{510,555,560,520,530,540,550,1}:QUIT
#510
cls
wind wr22wc78" Amortization table information:
The amortization table will need the following information:
Interest rate % (for 10.5% enter 10.5)
Total number of payments (for 3 years of monthly payments enter 36)
Number of payments per year (for monthly payments enter 12)
Loan principal (the amount of the loan)
Do you want a printout? (if yes enter Y and hit the ENTER key)
Note: Do not enter negitive numbers; you will get this information.
In some cases entering 0 is also not allowed.
From the above information, the amount of your payments will be shown at
the beginning of the table and will be printed and/or displayed with the
following information for each payment:
Payment number (starting with number 1)
Amount to Principal (the part of the payment going to principal)
Amount to Interest (the part of the payment going to interest)
Principal to date (total principal paid to date)
Interest to date (total interest paid to date)
Principal remaining (amount of loan remaining to be paid)
"
#515
head; Hit any key or mouse button to return to the main menu. ;
mon:i=kyin:moff:woff:goto1
#520
cls:wind wr22wc78" Effective earnings rate information:
Needs the following information.
Starting balance (Do not start with 0! Any percentage of 0 is 0)
Ending balance (including deposits)
Deposits made (total deposits made between start and end)
Number of days involved (must be greater then 0, if 1 year enter 365)
Note: Do not enter negitive numbers; you will get this information.
Returns the following information.
Effective earnings percentage rate (one time earnings rate)
Effective yearly percentage rate (non-compound rate per year)
(Effective earnings rate divided by years involved)
Note: The effective earnings rate is calculated assuming that all
deposits are made evenly throughout the time period involved.
If you do not make the deposits evenly, then I suggest you
leave the deposits out of the data and get your effective
earnings rate during the time periods between deposits.
This will give you the most accurate information.
"nn:goto515
#530
cls:wind wr22wc78" Loan Interest Rate information:
Needs the following information.
Number of payments (Total number of payments)
Number of payments each year (If monthly enter 12)
Amount of each payment
Loan principal (the amount of the loan)
Note: Do not enter negitive numbers or 0; you will get this information.
Returns the loan annual interest rate.
"nnnnnnnnnnn:goto515
#540
cls
wind wr22wc78 " Loan Payments information:
Needs the following information:
Interest rate % (for 10.5% enter 10.5)
Total number of payments (for 3 yrs. of monthly payments enter 3*12)
Number of payments per year (for monthly payments enter 12)
Loan principal (the amount of the loan)
Note: Do not enter negitive numbers; you will get this information.
In some cases entering 0 is also not allowed.
Returns the amount of each payment.
"nnnnnnnnnn:goto515
#550
cls
wind wr22wc78" Saving Table information:
Needs the following information:
Starting Balance (If none enter 0)
Interest rate (For 6% enter 6)
Number of years (The years to be calculated, 1 or more)
Compound rate (Yearly, semi-annually, quarterly, monthly)
Deposit rate (Yearly, monthly, weekly)
Deposit amount (Amount each deposit will be, can be 0)
Deposit increase rate (% increase in deposit per year, can be 0)
Print and/or display rate (End balance only, yearly, monthly, weekly)
Do you want a printout? (If yes enter Y and hit ENTER)
Note: Do not enter negitive numbers; you will get this information.
Prints and/or Displays the following information: (or end balances only)
Year number (Starting with year 1)
Display period (Starts at 1 each year)
Amount of deposit per period (Total made during this display period)
Amount of interest per period (Total made during this display period)
Total deposit to date (As of the end of the current period)
Total interest to date (As of the end of the current period)
Balance per period (As of the end of the current period)
":goto515
#555
cls:wind wr22wc78" Balance of loan information:
Needs the following information.
Number of payments left (Total number of payments left to pay)
Number of payments each year (If monthly enter 12)
Amount of each payment
Loan interest rate (For 8.5% enter 8.5)
Note: Do not enter negitive numbers or 0; you will get this information.
Returns the Balance of Loan Payoff.
"nnnnnnnnnnn:goto515
#560
cls:wind wr22wc78" Compound Interest information:
Needs the following information.
Number of years involved (Total number of years to calculate)
Times compounded per year (If monthly enter 12)
Starting balance (Starting value of the loan or account)
Yearly interest rate (If 8.5% enter 8.5)
Note: Do not enter negitive numbers or 0; you will get this information.
Returns the following information.
Compounded interest earned.
Interest earned plus principal.
"nnnnnnnnnnn:goto515
#600
call50:n'=0:xoff:call92
DSP N; BALANCE OF LOAN PAYOFF:;N
dsp n; Enter total number of payments left: ;:n'=inp{804}
if n'<0}555:if n'=0}1
dsp n; Enter number of payments per year: ;:n''=inp{802}
if n''=<0}555
dsp n; Enter amount of each payment: ;:p'=inp{811}
if p'=<0}555
dsp n; Enter loan interest rate: ;:i''=inp{800}
if i''=<0}555:hoff
i''=i''/100
p''=-P'*(1-((1+i''/n'')^n'))/(i''/n'')
digr2:digl8:dprn nn; BALANCE OF LOAN PAYOFF = ;(p'')
goto80
#610
call50:n'=0:xoff:call92
DSP N; COMPOUND INTEREST:;N
dsp n; Enter total number of years: ;:n'=inp{817}
if n'<0}560:if n'=0}1
dsp n; Enter number of times compounded per year: ;:n''=inp{818}
if n''=<0}560
dsp n; Enter starting balance: ;:p'=inp{819}
if p'=<0}560
dsp n; Enter yearly interest rate: ;:i''=inp{800}
if i''=<0}560:hoff
i''=i''/100
p''=P'*(1+I''/N'')^(N'*N'')
digr2:digl8:dprn nn; COMPOUND INTEREST = ;(p''-p')
dprn n; PLUS PRINCIPAL = ;(p'')
goto80
#800:windd ;
Enter the interest rate but do
not enter the % character. If
the interest rate is 10.5% enter
10.5 and hit the ENTER key.
Hit any key to continue.;X
wait40:woff:quit
#801:windd ;
Enter the total number of
payments over the length
of the loan. If you make
monthly payments for four
years, enter 48 or 4*12.
Hit any key to continue.;X
wait40:woff:quit
#802:windd ;
Enter the number of payments
you will make each year. If
you make monthly payments,
enter 12.
Hit any key to continue.;X
wait40:woff:quit
#803:windd ;
Enter the total amount of
the loan.
Hit any key to continue.;X
wait40:woff:quit
#804:windd ;
Enter the total number of
payments left to pay on
the loan. If you make
12 payments per year and
have 5 years and 2 months
left to pay, enter 5*12+2
or 62.
Hit any key to continue.;X
wait40:woff:quit
#805:windd ;
If you want a printout on the printer,
hit the Y key. If not hit the N key.
If you want a printout, make sure the
printer is turned on and there is
paper in the printer.
Hit any key to continue.;X
wait40:woff:quit
#806:windd ;
If the printer is on and ready to
print, enter Y. If not or you changed
your mind and do not want a printout
enter N, then hit the ENTER key.
Hit any key to continue.;X
wait40:woff:quit
#807:windd ;
Enter the amount you had in your
account at the start of the period
you want to know the effective
earnings percentage rate for. Do
not enter 0. (100% of 0 is 0)
Hit any key to continue.;X
wait40:woff:quit
#808:windd ;
Enter the amount you had in your
account at the end of the period
you want to know the effective
earnings rate for.
Hit any key to continue.;X
wait40:woff:quit
#809:windd ;
Enter the total amount of deposits made
to your account during the period you
you want to know the effective earnings
rate for.
Hit any key to continue.;X
wait40:woff:quit
#810:windd ;
Enter the total number of days between
the start and end of the earnings period.
If it was exactly one year, enter 365.
Hit any key to continue.;X
wait40:woff:quit
#811:windd ;
You should be making the same payment
amount each loan pay period. Enter
that amount here.
Hit any key to continue.;X
wait40:woff:quit
#812:windd ;
Enter the amount you had in your
account at the start of the period
you want the savings table for. If
you start with nothing, enter 0.
Hit any key to continue.;X
wait40:woff:quit
#813:windd ;
Enter the number of years you want
the savings table calculated for.
This must be in whole years.
Hit any key to continue.;X
wait40:woff:quit
#814:windd ;
Pick from the selections given
by entering the first character
of the selection you want to use.
Hit any key to continue.;X
wait40:woff:quit
#815:windd ;
Enter the amount of each deposit.
This program uses the same amount
for all deposits made during the
term of the savings table. So if
you are going to enter $50 each
deposit period, enter 50 here.
Hit any key to continue.;X
wait40:woff:quit
#816:windd ;
Enter the rate you think your deposits
will increase for inflation. If you
think your deposit amount will increase
5% each year, enter 5. The deposit
amount will increased by this amount
at the beginning of each year.
Hit any key to continue.;X
wait40:woff:quit
#817:windd ;
Enter the total number of years
the compound interest will be
calculated for. Do not enter
fractions of a year.
Hit any key to continue.;X
wait40:woff:quit
#818:windd ;
Enter the number of times per
year the interest will be
compounded. If compounded
monthly, enter 12.
Hit any key to continue.;X
wait40:woff:quit
#819:windd ;
Enter the starting value of
the account or loan you want
to compute interest on. Do
not enter 0.
Hit any key to continue.;X
wait 40:woff:quit